﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ProjectSem3.Admin
{
    public partial class WebForm14 : System.Web.UI.Page
    {
        public Order or=new Order();
        
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
                if (Request.QueryString["ID"] != null)
                {
                    dataDataContext dc = new dataDataContext();
                    var listord = dc.OrderDetails.Where(o => o.OrderID == Convert.ToInt32(Request.QueryString["ID"].ToString())).ToList();
                    if (listord.Count > 0)
                    {
                        or = listord[0].Order;
                        ListView1.DataSource = listord;
                        ListView1.DataBind();
                    }
                }
                else
                    Response.Redirect("Orders.aspx");
        }
    }
}